package top.kaoshanji.p1ch03c;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author kaoshanji
 * ^_^
 * create time 2025/4/23 10:57
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = BlankDiscEnvironmentConfig.class)
public class BlankDiscEnvironmentTest {

    @Autowired
    private BlankDiscEnvironment discEnvironment;

    /**
     * 代码清单test-p1ch03c-01：测试一下Environment引用外部值
     */
    @Test
    public void assertBlankDiscProperties() {
        Assert.assertEquals("The Beatles", discEnvironment.getArtist());
        Assert.assertEquals("Sgt. Peppers Lonely Hearts Club Band", discEnvironment.getTitle());
    }

   /* @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration(classes = BlankDiscEnvironmentConfig.class)
    public static class InjectFromProperties {

        @Autowired
        private BlankDiscEnvironment discEnvironment;

        @Test
        public void assertBlankDiscProperties() {

            Assert.assertEquals("The Beatles", discEnvironment.getArtist());
            Assert.assertEquals("Sgt. Peppers Lonely Hearts Club Band", discEnvironment.getTitle());

        }

    }*/



}
